QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Finding Associated Components

Video output components provide functions for finding other components associated with them. This section describes these functions.

To find any sound output components associated with a video output component, call the QTVideoOutputGetIndSoundOutput function.

To find a clock component associated with a video output component, call the QTVideoOutputGetClock function.

QTVideoOutputGetClock

If a video output component supports the optional QTVideoOutputGetClock function, your software can call the function to get a pointer to the clock component associated with the video output component.

pascal ComponentResult QTVideoOutputGetClock (
QTVideoOutputComponent vo,
ComponentInstance *clock);

vo Specifies the instance of a video output component for this request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

clock Contains a pointer to the clock component associated with the video output component.

DISCUSSION

Your software can use the clock component returned by the QTVideoOutputGetClock function to synchronize video and sound for a movie to the rate of the display. To associate the instance of the clock component with a movie, call the SetMovieMasterClock function.

Because a change to the display mode could affect a clock component, your software should call QTVideoOutputGetClock only between calls to QTVideoOutputBegin and QTVideoOutputEnd , when it is not possible to change the display mode.

When your software calls the QTVideoOutputEnd function, the video output component disposes of the instance of the clock component returned by the QTVideoOutputGetClock function. Because of this, software that uses the clock to control a movie must reset the clock for the movie to the default clock (by calling SetMovieMasterClock with nil as the value of the clock component) before calling QTVideoOutputEnd .

RESULT CODES

badComponentSelector

$800008002

The video output component does not have an associated clock component.

QTVideoOutputGetIndSoundOutput

If a video output component supports the optional QTVideoOutputGetIndSoundOutput function, your software can call the function to determine which sound output components are associated with the video output component.

pascal ComponentResult QTVideoOutputGetIndSoundOutput (
QTVideoOutputComponent vo,
long index,
Component *outputComponent);

vo Specifies the instance of a video output component for this request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

index Specifies which of the sound output components to return. The index of the first component is 1.

outputComponent
Contains a pointer to a sound output component associated with the video output component that is specified by the index parameter.

DISCUSSION

Your software can display sound output components returned by the QTVideoOutputGetIndSoundOutput function in a dialog box and let the user choose which outputs to use for movie playback.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next